import { Vec3 } from '@/core/types';
import * as THREE from 'three';

export enum EntityType {
  // 友好生物
  COW = 'cow',
  PIG = 'pig',
  SHEEP = 'sheep',
  CHICKEN = 'chicken',
  
  // 敌对生物
  ZOMBIE = 'zombie',
  SKELETON = 'skeleton',
  SPIDER = 'spider',
  CREEPER = 'creeper',
  ENDERMAN = 'enderman'
}

export interface BoundingBox {
  min: Vec3;
  max: Vec3;
}

export interface EntityData {
  id: string;
  type: EntityType;
  position: Vec3;
  rotation: number;
  health: number;
  maxHealth: number;
  velocity: Vec3;
  onGround: boolean;
  age: number;
}

export enum AIState {
  IDLE = 'idle',
  WANDERING = 'wandering',
  FOLLOWING = 'following',
  FLEEING = 'fleeing',
  ATTACKING = 'attacking',
  DEAD = 'dead'
}

export interface AIBehavior {
  state: AIState;
  target?: Vec3;
  targetEntity?: string;
  stateTimer: number;
  lastStateChange: number;
}

export interface EntityStats {
  maxHealth: number;
  moveSpeed: number;
  jumpHeight: number;
  attackDamage?: number;
  attackRange?: number;
  detectionRange: number;
  size: { width: number; height: number };
}

export interface DropItem {
  type: string;
  count: number;
  chance: number;
}